|
|
|
|
|
|
|
LONG DaylightBias;
} TIME_ZONE_INFORMATION; |
|
|
|
|
|
|
|
|
The Bias field indicates a time difference in minutes from UTC such that UTC = your local time + Bias. The StandardBias field indicates the additional bias when standard time is in effect. The DaylightBias field indicates the additional bias when daylight savings time is in effect. |
|
|
|
|
|
|
|
|
The StandardDate field is the date when the system should switch from daylight savings time to standard time. The DaylightDate field is the date when the system should switch from standard time to daylight savings time. The StandardName and DaylightName fields indicate the name of the time zone when in standard time and daylight savings time, respectively. |
|
|
|
|
|
|
|
|
A SYSTEMTIME is another structure, defined as follows: |
|
|
|
|
|
|
|
|
typedef struct _SYSTEMTIME { // st
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME; |
|
|
|
|
|
|
|
|
A WORD parameter is a 16-bit unsigned value. We'll use the Visual Basic Integer type because it is 16 bits long, and we can always convert from signed to unsigned if necessary (it won't be with this structure). |
|
|
|
|
|
|
|
|
The tz.vbp application uses the GetTimeZoneInformation function to retrieve and display information about the current time zone. |
|
|
|
|
|
|
|
|
The tz.vbp program (on the CD that comes with this book) contains the following code: |
|
|
|
|
|
|
|
|
' Get Time Zone Information
' Copyright © 1998 by Desaware Inc. All Rights Reserved
Option Explicit
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer |
|
|
|
|
|